<?php
// 后台学校管理模块
class SchoolAction extends CommonAction {
	function _filter(&$map){
		//$map['id'] = array('egt',1);
		$map['sName'] = array('like',"%".$_POST['sName']."%");
		if(0!=$_SESSION['dwid'])$map['id'] = array('eq',$_SESSION['dwid']);
	}
	public function foreverdelete() {
        //删除指定记录
        $name = $this->getActionName();
        $model = D($name);
        if (!empty($model)) {
            $pk = $model->getPk();
            $id = $_REQUEST [$pk];
            if (isset($id)) {
                $condition = array($pk => array('in', explode(',', $id)));
                if (false !== $model->where($condition)->delete()) {
                    //echo $model->getlastsql();
                    $this->success('删除成功！',true);
                } else {
                    $this->error('删除失败！',false);
                }
            } else {
                $this->error('非法操作',false);
            }
        }
        $this->forward();
    }
}
?>